package com.xuzimian.globaldemo.jmx.mxbean;

import com.xuzimian.globaldemo.jmx.standard.Hello;

import javax.management.Notification;
import javax.management.NotificationListener;

/**
 * @program: global-demo
 * @description:
 * @author: xzm
 * @create: 2019-01-24 17:01
 **/
public class QueueListener implements NotificationListener {
    @Override
    public void handleNotification(Notification notification, Object handback) {
        if(handback instanceof Hello)
        {
            Hello hello = (Hello)handback;
            System.out.println("QueueListener msg:"+notification.getMessage());
            System.out.println("QueueListener type:"+ notification.getType());
            System.out.println(hello.getName());
        }
    }
}
